import request from '@/utils/request'

export const AdminApi = {
    /**
     *  管理员列表
     * @returns
     */
    getPage: (data) => {
        return request({
            url: '/manage/system/admin/getPage',
            data,
            method: 'post'
        })
    },
    /**
     *  更新状态
     * @returns
     */
    updateStatus: (data) => {
        return request({
            url: '/manage/system/admin/updateStatus',
            data,
            method: 'post'
        })
    },
    /**
     *  删除
     * @returns
     */
    delete: (adminId) => {
        return request({
            url: '/manage/system/admin/delete',
            params: {adminId},
            method: 'get'
        })
    },

    /**
     *  重置密码
     * @returns
     */
    restPassword: (adminId) => {
        return request({
            url: '/manage/system/admin/restPassword',
            params: {adminId},
            method: 'get'
        })
    },

    /**
     *  获取详细信息
     * @returns
     */
    getInfoById: (id) => {
        return request({
            url: '/manage/system/admin/getInfoById',
            params: {id},
            method: 'get'
        })
    },

    /**
     *  获取用户列表
     * @returns
     */
    getList: (params) => {
        return request({
            url: '/manage/system/admin/getList',
            params: params,
            method: 'get'
        })
    },

    /**
     *  更新
     * @returns
     */
    update: (data) => {
        return request({
            url: '/manage/system/admin/update',
            data,
            method: 'post'
        })
    },

    /**
     *  插入
     * @returns
     */
    insert: (data) => {
        return request({
            url: '/manage/system/admin/insert',
            data,
            method: 'post'
        })
    },

    /**
     *  登录
     * @returns
     */
    login: (data) => {
        return request({
            url: '/manage/system/admin/login',
            data,
            method: 'post'
        })
    },

    /**
     *  获取验证码
     * @returns
     */
    getKaptcha: () => {
        return request({
            url: '/kaptcha',
            method: 'get'
        })
    },

    /**
     *  获取用户信息
     * @returns
     */
    getInfo: () => {
        return request({
            url: '/manage/system/admin/getInfo',
            method: 'get'
        })
    },

    /**
     *  修改密码
     * @returns
     */
    updatePassword: (data) => {
        return request({
            url: '/manage/system/admin/updatePassword',
            data,
            method: 'post'
        })
    },

}
